﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITS.Core.Domain.Users;

namespace ITS.Core.ViewModel.Users
{
    public class UserSessionModel
    {
        public Guid UserID;
        public String Username;
        public String DisplayName;
        public IEnumerable<Role> Roles;

        public static UserSessionModel FromUser(User user)
        {
            UserSessionModel model = new UserSessionModel()
            {
                UserID = user.UserID,
                Username = user.UserName,
                DisplayName = user.UserExtended.DisplayName,
                Roles = user.Roles
            };
            return model;
        }
    }
}
